<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-图灵谷-全局配置-全局配置|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=gconfig,child=model)">菜单栏</div>
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>全局配置</cite></a> <a href="#">模型配置</a> <a><cite>列表</cite></a>
					</span>
				</div>
				<!--/*******操作*******/-->
				<form th:action="@{/admin/m/base/model/list.gsp}" method="get">
					<div class="layui-form-item">
						<blockquote class="layui-elem-quote layui-quote-nm">
							<div class="layui-inline">
								<div class="layui-input-inline">
									<a th:href="@{/admin/m/base/model/add.gsp}" class="layui-btn"> <i class="layui-icon">&#xe608;</i> 新增
									</a>
								</div>
							</div>
							<div class="layui-inline" style="float: right;">
								<div class="layui-input-inline">
									<select id="modelType" name="type" class="layui-select">
										<option value="" selected>全部模型类型</option>
										<option value="info">文档模型</option>
										<option value="node">栏目模型</option>
										<option value="special">专题模型</option>
									</select>
									<button class="layui-btn" lay-submit="" lay-filter="searchForm">
										<i class="layui-icon">&#xe615;</i>
									</button>
								</div>
							</div>
						</blockquote>
					</div>
				</form>
				<table cellspacing="0" width="100%" class="layui-table" lay-even="" lay-skin="row">
					<thead>
						<tr>
							<th width="40" class="text-center">#</th>
							<th>类型</th>
							<th>名称</th>
							<th>备注</th>
							<th width="200" class="text-center">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr th:if="${modelList == null or modelList.size() == 0}">
							<td colspan="5" style="text-align: center;">暂时没有数据</td>
						</tr>
						<tr th:each="item,itemStat:${modelList}">
							<td th:text="${itemStat.index+1}" style="text-align: center;"></td>
							<td style="text-align: center;"><label th:if="${item.type=='info'}">文档模型</label> <label th:if="${item.type=='node'}">栏目模型</label> <label th:if="${item.type=='special'}">专题模型</label></td>
							<td th:text="${item.modelName}" style="text-align: center;"></td>
							<td th:text="${item.description}"></td>
							<td><a th:href="|@{/admin/m/base/model/edit_}${item.id}.gsp|" class="layui-btn layui-btn-small"> <i class="layui-icon"></i></a> <a th:href="|@{/admin/m/base/customField/fields_}${item.id}.gsp|" class="layui-btn layui-btn-small"> <i class="layui-icon">字段管理</i></a> <a
								th:onclick="|del('${item.id}')|" class="layui-btn layui-btn-normal layui-btn-small"> <i class="layui-icon"></i></a></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
</html>
<script th:inline="javascript">
    /*<![CDATA[*/
    var result = /*[[${modelList}]]*/;
    $(function(){
        $("#modelType").val(GetQueryString("type"));
        var option = {
            listUrl : /*[[@{/admin/m/base/model/list.gsp?}]]*/,
            totalPages : result.totalPages,
            page : result.page,
            param : {
                modelType
            }
        };
        tg_basePage(option);
    })
     var deleteUrl = /*[[@{/admin/m/base/model/delete_{id}.gsp}]]*/;
    function del(id){
        tg_deleteItem(deleteUrl.replace('{id}',id), function(){
            location.reload();
        });       
    }
    /*]]>*/
</script>
